/**
 * Created by 10446 on 2017/7/13.
 */

var vue = new Vue({

    el:'.timeline-content',
    data:{
        timenow:'1997',
        items: [
            {time: '2017'}
        ]
    },
    methods: {
        timeClick: function (time) {
            this.timenow=time;
            parent.getSummary(time);
            parent.timenow=time;

        }
        }
});

function getYear() {
    var url = 'http://localhost:8080/getLine';
    var request = new XMLHttpRequest();
    request.open('get',url);

    request.onreadystatechange = function(){
        if( request.status === 200 ){
            var res = request.responseText;
            try{
                vue.items= JSON.parse(res).timeline;
            }catch (e){

            }
        }
    }
    request.send();
}

getYear();